<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'The pattern',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/09/14.jpg" alt="The house now has shingles" class="framed-centred-image" width="649" height="480"/>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<h3>Part 0</h3>
		<p>
			You could find the average number of fruit you have in each category.
			You have, on average, one and a third of each fruit type.
			I&apos;d argue this isn&apos;t a very useful statistic, but it is in fact possible to compute and understand.
			While you can&apos;t average the words &quot;apples&quot;, &quot;banana&quot;, and &quot;cherry&quot;, each fruit type had a quantity attached, and those quantities can in fact be averaged.
			This isn&apos;t very useful information, so you wouldn&apos;t typically <strong>*want*</strong> to find the average.
			Where numbers are present in one form or another though, you can always find a way to get some sort of average, provided those numbers represent some sort of sensible quantity.
			Where numbers are used as arbitrary labels (&quot;Fruit 0&quot;, &quot;Fruit 1&quot;, &quot;Fruit2&quot;, for example), the numbers aren&apos;t really used as numbers at all, so they cannot be averaged.
		</p>
		<p>
			The fruits are identified by strings, not numbers, so they&apos;d be identified in R as factors.
			In some cases, numbers can be used as factors as well, usually when the numbers don&apos;t relate to one another in any numeric fashion, but if the names aren&apos;t numbers at all, you know you&apos;re not dealing with numeric data.
			And the only alternative we have to numeric values is factors.
		</p>
		<h3>Part 1</h3>
		<p>
			The average of the given test scores is <code>68</code>.
			These values are numbers, and actually relate to each other in a sensible and expected way.
			For reason, we should encode them as numeric values.
		</p>
		<h3>Part 2</h3>
		<p>
			We can average the number of grades you got of each letter, but we can&apos;t average letter grades themselves.
			This makes the situation identical to the fruit problem.
			We would need to translate the letters into numbers using some sort of scale before any sort of averaging in that way could be performed.
			Typically, the scale would be something like A = <code>4</code>, B = <code>3</code>, C = <code>2</code>, D = <code>1</code>, F = <code>0</code>.
		</p>
		<p>
			To be clear, we can&apos;t average the letter grades.
			However, if we were to used the aforementioned scale to male it possible, we&apos;d end up with a grade of <code>2.75</code>.
			If we round to the nearest integer, that gives us a B.
			If we round down so students must meet the expectations of a letter grade rather than just be closer to the high value than the low value, that gives us a C.
			Again, it depends on how your grade-averaging is set up.
			Letter grades are obviously a bad idea; numeric grades make much more sense.
		</p>
		<p>
			Being letters and not comparable numbers, these would be encoded as factors.
		</p>
		<h3>Part 3</h3>
		<p>
			The difference in the mean values between #1 and #2, if you&apos;ve paid attention, is that #2 has no average.
			It as a mode (highest occurrence of a particular value), but no mean (numeric average).
			Additionally, the letters were likely obtained from the numbers initially.
			In translating numeric ranges into mere letters, precision was lost.
			Again, numeric grades are superior.
		</p>
		<p>
			Even when I used a conversion table, I converted the letters not to the score that would have yielded a particular letter grade, but instead to the number of grade points the letter would likely be worth.
			If using instead the likely initial scores, we&apos;d have something closer to A = <code>100</code>, B = <code>90</code>, C = <code>80</code>, D = <code>70</code>, F = <code>60</code>.
			This gives us a more comparable average, <code>90</code>, which would translate to a B.
			This gives the student a higher score in #2 than #1, due again to loss of precision.
		</p>
	</blockquote>
</section>
<section id="broken">
	<h2>Broken website</h2>
	<p>
		I sent an angry message to the credit union based on yesterday&apos;s findings:
	</p>
	<blockquote>
		<p>
			Not too long ago, you told me that you couldn&apos;t support basic features, such as access to the profile information, on Firefox 45.
			Firefox 45 was just too different from Firefox 62.
			It turns out this was a lie.
			I tried modifying my User-Agent headers, and it seems Firefox 45 is more than capable of accessing the profile information if your website thinks it&apos;s dealing with Firefox 62.
			The only problem is that your website is deliberately denying service to Firefox 45 for no valid reason.
		</p>
		<p>
			Well, that&apos;s not the *only* problem.
			When setting my browser to say it&apos;s Firefox 62, I can&apos;t log in.
			Your website is sending different log in code to different Web browsers.
			On the surface, it looks like the different code is working, but look at the actual facts: if you used XHTML or HTML for the log in form instead of JavaScript, you&apos;d only need one set of log-in code and it&apos;d work on all Web browsers.
		</p>
		<p>
			So anyway, if I need to update my profile information, such as my email address or postal address, I have to tell my Web browser to say it&apos;s Firefox 45, log in, then tell it to say it&apos;s Firefox 62 so your site will send the code needed to access the profile information.
			Again, it&apos;d save a lot of hassle if the profile information could be accessed via XHTML or HTML instead of JavaScript.
			This is an example of incredibly poor Web design on your part.
			Firefox 45 is clearly able to handle the profile section code, your site just refuses to send it if it realises Firefox 45 is in use.
			W3C standards are important.
			Please stop denying service based on the User-Agent header and sending different code to different browsers.
			A well-coded webpage will work in any modern (think last ten years, not last six months) Web browser.
		</p>
		<p>
			When I switch User-Agents after logging in, your website hits me with an obnoxious CloudFlare CAPTCHA wall.
			When I did this yesterday, it made me fill out upwards of twenty CAPTCHAs before it&apos;d let me pass.
			Today, it made me fill out fifteen.
			This is completely unacceptable. not only do I have to install header modifiers to make basic features of your website work, but I also have to solve over a dozen CAPTCHAs every time I log in.
		</p>
		<p>
			Please fix your broken website.
		</p>
	</blockquote>
</section>
<section id="deposit">
	<h2>Bottle deposits</h2>
	<p>
		Recently, I expressed in this journal my annoyance that the bottle redemption centre is trying to bribe people into spending their recovered deposits at select retailers.
		Honestly, it seemed like some sort of underhanded partnership thing.
		Those retailers were likely offering the redemption centre some sort of kickback, or rather, not charging them the full amount for the spent credits.
		I also hypothesised that the redemption centre was probably trying to reduce the flow of outgoing cash so they could cut the number of incoming cash cash shipments.
		The cash trucks probably cost a pretty penny, but if you mandate a cash deposit, it&apos;s your obligation to provide a cash return.
	</p>
	<p>
		I got a little more of the story today though.
		I think.
		Someone told me it&apos;s an effort by the redemption centre to control where poor people spend money as was already quite obvious, but not for the reasons I&apos;d initially thought.
		Rather, the pattern is supposedly that the retailers that are allowed to take these credits are the ones that carry <strong>*groceries*</strong>.
		Whoever is in charge here is trying to get poor people to buy food instead of whatever else they might&apos;ve bought instead, such as - and I&apos;m just throwing this out there - marijuana.
		Seriously, the people around here are such potheads.
		Or maybe they&apos;d buy lottery tickets with the deposits.
		Being poor is one thing, but being stupid and poor leads to a lot of lottery ticket purchases by people that don&apos;t properly understand how probabilities work.
		If the government is trying to bribe poor people into spending their money on groceries instead, that&apos;s not such a bad thing.
	</p>
	<p>
		I can&apos;t help but feel their plan might backfire though.
		Some poor people try to drink their pain away, and grocery stores tend to carry alcohol.
		As for me, I&apos;m a fatso.
		Aside from rent, groceries are my biggest expense.
		if most grocery stores are taking these credits, I can definitely use them well.
		It&apos;s not like this bribe changes my spending habits though.
		I&apos;m buying groceries either way.
		But I&apos;d be happier to know that I&apos;m not buying into som nefarious plot.
		I do want to look into this further when I have time.
		I&apos;ll check out the list of retailers at the redemption centre on Tuesday when I go.
		I&apos;d love to verify that grocery stores are the pattern.
	</p>
</section>
END
);
